﻿@using ALinq.BBS.App_GlobalResources
@using ALinq.BBS.DataAccess
@using ALinq.BBS.Common
@model ALinq.BBS.Models.UserModel
@{
    PageData["Title"] = Label.ControlPanel;
    PageData["Styles"] = new[] { "/Scripts/syntaxhighlighter/styles/shCoreDefault.css" };
    PageData["Css"] = "EditUser.css";

    Layout = "_Layout.cshtml";

    var user = new Users().Single(o => o.Name == User.Identity.Name);
    var member = Membership.GetUser();
}
<div class="pageTitle">
    修改资料</div>
<div style="background-color: #fffbff; font-size: 12px; text-align: left;">
    <hr style="height: 2px; color: #ffcf63" />
    <input id="event" name="event" type="hidden" value="update" />
    <table border="0" cellspacing="0">
        <tr>
            <td class="p_lable">
                @Label.UserName@Label.Colon
            </td>
            <td class="_item">
                @User.Identity.Name
            </td>
        </tr>
        <tr>
            <td class="p_lable">
                @Label.Email@Label.Colon
            </td>
            <td class="_item">
                @member.Email
            </td>
        </tr>
        <tr>
            <td class="p_lable">
                @Label.PostsCount@Label.Colon
            </td>
            <td class="_item">
                @user.PostsCount
            </td>
        </tr>
        <tr>
            <td class="p_lable">
                @Label.HomePage@Label.Colon
            </td>
            <td class="_item">
                @*<input name="webSite" type="text" id="webSite" value="<%=user.WebSite %>" 
                                style="width: 270px;"/>*@
                @Html.TextBoxFor(o => o.WebSite)
                <span class="tip" style="margin-left: 30px;">格式如: http://www.koloBBS.cn</span>
            </td>
        </tr>
        <tr>
            <td class="p_lable">
                @Label.Profession@Label.Colon
            </td>
            <td class="_item">
                @Html.TextBoxFor(o => o.Profession)
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <hr style="color: #dedfde" />
            </td>
        </tr>
        <tr>
            <td class="p_lable">
                @Label.Photo@Label.Colon
            </td>
            <td>
                <label>
                    @Label.Enable</label>
                @Html.RadioButtonFor(o => o.EnablePhote, Model.EnablePhote)
                <label>
                    @Label.Disable</label>
                @Html.RadioButtonFor(o => o.EnablePhote, !Model.EnablePhote)
                <div class="tip">
                    启用此选项，你发表的每一个帖子左侧将显示您的头像。</div>
            </td>
        </tr>
        <tr>
            <td class="p_lable">
                当前头像：
            </td>
            <td>
                <img id="userPhoto" alt="" src="@Model.Photo" />
                @*<input type="hidden" id="photo" name="photo" value="<%=user.Photo %>" />*@
                @Html.HiddenFor(o => o.Photo)
            </td>
        </tr>
        @if (ForumSection.Instance.Header.EnableUpload)
        { 
            <tr>
                <td class="p_lable">
                    上传新头像：
                </td>
                <td>
                    <input name="userPhoto" type="file" />
                </td>
            </tr>
        }
        <tr>
            <td class="p_lable">
                系统相册：
            </td>
            <td>
                <input type="button" value="打开系统相册" onclick="OpenSystemPhotos()" />
                <div class="tip">
                    从系统相册中选择一个头像（如果您的浏览器打开了屏蔽弹出窗口的功能，请关闭）。</div>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <hr style="color: #dedfde" />
            </td>
        </tr>
    </table>
    <table cellpadding="0" cellspacing="0">
        <tr>
            <td class="p_lable">
                个人签名：
            </td>
            <td style="font-size: 13px">
                <label>
                    @Label.Enable</label>
                @Html.RadioButtonFor(o => o.EnableSignPicture, Model.EnableSignPicture)
                <label>
                    @Label.Disable</label>
                @Html.RadioButtonFor(o => o.EnableSignPicture, !Model.EnableSignPicture)
                <div class="tip">
                    启用此选项，你发表的每一个帖子后面将符上您的个人签名档。</div>
            </td>
        </tr>
        @if (!string.IsNullOrEmpty(Model.SignPictrue))
        {
            <tr>
                <td class="p_lable">
                    当前签名图：
                </td>
                <td>
                    <a href="@Model.SignPictrue">
                        <img alt="" style="margin-bottom: 4px;" src="@Model.SignPictrue" /></a>
                </td>
            </tr>
        }
        <tr>
            <td class="p_lable">
                更新签名图：
            </td>
            <td>
                <input id="singPicture" name="signPicture" type="file" />
                <div class="tip">
                    要求：图片尺寸468*60像素，文件大小100k以内（支持JPG，GIF）。</div>
            </td>
        </tr>
        <tr>
            <td class="p_lable">
                签名：
            </td>
            <td>
                @*<textarea name="sign" cols="40" rows="4" id="sign" style="width: 400px; height: 80px;"><%=user.Sign%></textarea>*@
                @Html.TextAreaFor(o => o.SignText, new { cols = "40", rows = "4", style = "width: 400px; height: 80px;" })
                <div class="tip">
                    要求：签名不能超过82个字</div>
            </td>
        </tr>
        @*<tr>
                        <td class="p_lable">
                            签名链接：</td>
                        <td>
                            <input name="signUrl" type="text" id="signUrl" style="width: 400px;" value="<%=user.SignUrl %>" />
                            <div class="tip">
                                格式例如:http://www.Kolo.net.cn 要求：签名链接不能超过100个字</div>
                        </td>
                    </tr>*@
        <tr>
            <td colspan="2">
                <hr style="color: #dedfde" />
            </td>
        </tr>
    </table>
    <table style="width: 100%" cellpadding="0" cellspacing="0">
        <tr>
            <td class="p_lable">
                @Label.NickName
            </td>
            <td>
                @*<input type="text" name="nickName" id="nickName" value="<%=user.NickName %>" />*@
                @Html.TextBoxFor(o => o.NickName)
            </td>
            <td align="center">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td class="p_lable">
                @Label.Gender@Label.Colon
            </td>
            <td>
                <label>
                    男</label>
                @Html.RadioButtonFor(o => o.Gender, Model.Gender == ALinq.BBS.Models.Gender.Male)
                <label>
                    女</label>
                @Html.RadioButtonFor(o => o.Gender, Model.Gender == ALinq.BBS.Models.Gender.Female)
            </td>
            <td align="center">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td class="p_lable">
                QQ：
            </td>
            <td>
                <input name="QQ" type="text" id="QQ" value="@Model.QQ" />
            </td>
            <td align="center">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td class="p_lable">
                ICQ：
            </td>
            <td>
                <input name="ICQ" type="text" id="ICQ" value="@Model.ICQ" />
            </td>
            <td align="center">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td class="p_lable">
                MSN：
            </td>
            <td>
                <input name="MSN" type="text" id="MSN" value="@Model.MSN" />
            </td>
            <td align="center">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;
            </td>
            <td>
                <input name="update" type="submit" id="update" value="提交" />
            </td>
            <td align="center">
                &nbsp;
            </td>
        </tr>
    </table>
    <hr style="height: 2px; color: #ffcf63" />
</div>
